package com.whale.cloud.util.kafka;

import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/** Created by Abel on 2017/5/25. */
@Configuration
@ConditionalOnBean(KafkaProperties.class)
@ConditionalOnProperty(prefix = "spring.kafka.consumer", value = "enabled", matchIfMissing = false)
public class KafkaAutoConfiguration {

  @Bean
  public MKafkaProducer mKafkaProducer() {
    return new MKafkaProducer();
  }

  @Bean
  public MKafkaConsumer mKafkaConsumer() {
    return new MKafkaConsumer();
  }
}
